package com.grape.service.base.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.grape.dao.base.AreaRepository;
import com.grape.domain.base.Area;
import com.grape.service.base.AreaService;

@Service
@Transactional
public class AreaServiceImpl implements AreaService {

	@Autowired
	private AreaRepository ar;
	
	@Override
	public void saveBatch(List<Area> la) {
		ar.save(la);
	}

	@Override
	public Page<Area> findAll(Specification<Area> sa,Pageable pageable) {
		return ar.findAll(sa, pageable);
	}

	@Override
	public Area findByProvinceAndCityAndDistrict(String province, String city, String district) {
		return ar.findByProvinceAndCityAndDistrict(province,city,district);
	}


}
